﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CodeFactory
{
    public partial class CodeShopNewFolder : Form
    {
        public CodeShopNewFolder()
        {
            InitializeComponent();
        }


        public delegate void AddNewFolderEventHandler(string FolderName);
        public delegate bool HasSameFolderEventHandler(string FolderName);

        public AddNewFolderEventHandler AddNewFolder;
        public event HasSameFolderEventHandler HasSameFolder;


        private void button1_Click(object sender, EventArgs e)
        {
            if (!HasSameFolder(textBox1.Text.Trim()))
            {
                AddNewFolder(textBox1.Text.Trim());
                this.Close();
            }
            else
            {
                MessageBox.Show("已经存在相同种类");
            }
        }
    }
}
